package Handin_2;

public class StringManipulator {
//Instance vairiables
	private String s1="";
	private String s2="";

//constructor
	public StringManipulator(String s1, String s2){
		this.s1=s1;
		this.s2=s2;		
	}
//Methods (Jeg vil gerne vide om der er nogen ulempe ved at lave disse statiske?)
	
/**
 * toCamelCase combines to Strings and returns them as CamelCase	
 * @param s1 the first string
 * @param s2 the second string
 * @return String wiht the combination in CamelCase.
 */
	public static String toCamelCase(String s1, String s2){
		String p1 = s1.toLowerCase();
		String p2 = s2.substring(0,1);
		p2 = p2.toUpperCase();
		String p3 = s2.substring(1);
		p3 = p3.toLowerCase();
		return p1+p2+p3;		
	}
	/**
	 * oddOrEvenLength determines whether a string has an odd er even length.
	 * @param s1 the string.
	 * @return int 0 reads as equal, 1 as odd.
	 */
	public static int oddOrEvenLength(String s1){
		int length = s1.length();
		int result = length % 2;
		return result;
	}
	/**
	 * initialsFromName combines the first letters of two
	 * strings into an initials string.
	 * @param s1 the first string
	 * @param s2 the second string
	 * @return String formatted like initials
	 */
	public static String initialsFromName(String s1, String s2){
		String i1=s1.substring(0,1).toUpperCase();
		String i2=s2.substring(0,1).toUpperCase();
		return i1+"."+i2+".";
	}
	
	
	
	
	//, oddOrEvenLength, initialsFromName
	
	
}
